/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.ManagerRolePrivilege;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface ManagerRolePrivilegeMapper {
    /* @mbggenerated */
    @Delete({
        "delete from manager_role_privilege",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /* @mbggenerated */
    @Insert({
        "insert into manager_role_privilege (id, role_id, ",
        "privi_id, state, ",
        "create_user, create_time, ",
        "upd_user, update_time)",
        "values (#{id,jdbcType=INTEGER}, #{roleId,jdbcType=INTEGER}, ",
        "#{priviId,jdbcType=INTEGER}, #{state,jdbcType=TINYINT}, ",
        "#{createUser,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updUser,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})"
    })
    int insert(ManagerRolePrivilege record);

    /* @mbggenerated */
    @InsertProvider(type=ManagerRolePrivilegeSqlProvider.class, method="insertSelective")
    int insertSelective(ManagerRolePrivilege record);

    /* @mbggenerated */
    @Select({
        "select",
        "id, role_id, privi_id, state, create_user, create_time, upd_user, update_time",
        "from manager_role_privilege",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="role_id", property="roleId", jdbcType=JdbcType.INTEGER),
        @Result(column="privi_id", property="priviId", jdbcType=JdbcType.INTEGER),
        @Result(column="state", property="state", jdbcType=JdbcType.TINYINT),
        @Result(column="create_user", property="createUser", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="upd_user", property="updUser", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    ManagerRolePrivilege selectByPrimaryKey(Integer id);

    /* @mbggenerated */
    @UpdateProvider(type=ManagerRolePrivilegeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ManagerRolePrivilege record);

    /* @mbggenerated */
    @Update({
        "update manager_role_privilege",
        "set role_id = #{roleId,jdbcType=INTEGER},",
          "privi_id = #{priviId,jdbcType=INTEGER},",
          "state = #{state,jdbcType=TINYINT},",
          "create_user = #{createUser,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "upd_user = #{updUser,jdbcType=INTEGER},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ManagerRolePrivilege record);
}